<?php
// +----------------------------------------------------------------------
// | Author: 
// +----------------------------------------------------------------------

namespace app\wechat\controller;
/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class IndexController extends AuthController {
    /**
     * 封面
     */
    public function index(){
        $store_id = input('store_id');
        $seat_id = input('seat_id');
        $oNoteInfo =  db('CommonEnum')->where(['mode_name'=>'订单配置','enum_name'=>'购买规则'])->find();
        $this->assign([
            'store_id'=>$store_id,
            'oNoteInfo' => $oNoteInfo,
            'seat_id'=>$seat_id
        ]);
        return $this->fetch('index');
    }
    /**
     * 借
     */
    public function hire(){
        $store_id = input('store_id');
        $seat_id = input('seat_id');
        $hNoteInfo =  db('CommonEnum')->where(['mode_name'=>'订单配置','enum_name'=>'租借规则'])->find();
        $this->assign([
            'store_id'=>$store_id,
            'hNoteInfo' => $hNoteInfo,
            'seat_id'=>$seat_id
        ]);
        return $this->fetch('hire');
    }
    /**
     * 归还
     */
    public function returns(){
        $store_id = input('store_id');
        $seat_id = input('seat_id');
        $rNoteInfo =  db('CommonEnum')->where(['mode_name'=>'订单配置','enum_name'=>'归还规则'])->find();
        $this->assign([
            'store_id'=>$store_id,
            'rNoteInfo' => $rNoteInfo,
            'seat_id'=>$seat_id
        ]);
        return $this->fetch('returns');
    }
}